package com.south.base.test.gitlab;

import cn.hutool.core.lang.Assert;
import org.gitlab4j.api.CommitsApi;
import org.gitlab4j.api.GitLabApi;
import org.gitlab4j.api.GitLabApiException;
import org.gitlab4j.api.models.Branch;
import org.gitlab4j.api.models.BranchAccessLevel;
import org.gitlab4j.api.models.Comment;
import org.gitlab4j.api.models.Commit;
import org.junit.Test;

import java.util.List;

/**
 * @author xiezz32926
 * @date 2021/1/22 15:28
 */
public class GitLab {
    private static final Long PROJECT_ID = 790L;
    @Test
    public void getCommits() throws GitLabApiException {
        GitLabApi gitLabApi = GitLabApi.oauth2Login("https://gitlab.hundsun.com/", "xiezz32926", "Hund3un@0001");

        CommitsApi commitsApi = new CommitsApi(gitLabApi);
        List<Commit> comments = commitsApi.getCommits("HEP/HEP-PM", "develop", null, null, null);
        Assert.notNull(comments);
    }
}
